<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Language" content="en" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Draggable Demo</title>
<link rel="stylesheet" href="../themes/flora/flora.all.css" type="text/css" media="screen" title="Flora (Default)" />
<link rel="stylesheet" href="css/style.css" type="text/css" />

<script type="text/javascript" src="../jquery-1.2.4b.js"></script>

<script type="text/javascript" src="../ui.core.js"></script>
<script type="text/javascript" src="../ui.draggable.js"></script>

<style type="text/css">
.example { height: 50px; width: 100px; }
</style>

</head>
<body class="flora">

<h2>1. Default, no options</h2>
<div class="playground" style='height: 400px;'>
	<div id='example1' class="ui-wrapper example" style='background: #E6F7D4; width: 500px; height: 300px;'>
		<div style='position: absolute; top: 20px; left: 20px; bottom: 20px; right: 20px;'>Drag me</div>
	</div><br />
	<button onclick="$('#example1').draggable('enable')">Enable</button>
	<button onclick="$('#example1').draggable('disable')">Disable</button>
</div>

<h2>2. Clone as helper</h2>
<div class="playground">
	<div id='example2' class="ui-wrapper example" style='background: #E6F7D4;'>
		<div style='position: absolute; top: 20px; left: 20px; bottom: 20px; right: 20px;'>Drag me</div>
	</div>
</div>

<h2>3. Custom helper, cursor at -5,-5</h2>
<div class="playground">
	<div id='example3' class="ui-wrapper example" style='background: #E6F7D4;'>
		<div style='position: absolute; top: 20px; left: 20px; bottom: 20px; right: 20px;'>Drag me</div>
	</div>
</div>

<h2>4. Reverting</h2>
<div class="playground">
	<div id='example4' class="ui-wrapper example" style='background: #E6F7D4;'>
		<div style='position: absolute; top: 20px; left: 20px; bottom: 20px; right: 20px;'>Drag me</div>
	</div>
</div>

<h2>5. A certain axis only</h2>
<div class="playground">
	<div id='example5' class="ui-wrapper example" style='background: #E6F7D4;'>
		<div style='position: absolute; top: 20px; left: 20px; bottom: 20px; right: 20px;'>Drag me</div>
	</div>
</div>

<h2>6. Contain to parent</h2>
<div class="playground">
	<div id='example6' class="ui-wrapper example" style='background: #E6F7D4;'>
		<div style='position: absolute; top: 20px; left: 20px; bottom: 20px; right: 20px;'>Drag me</div>
	</div>
</div>

<h2>7. Grid</h2>
<div class="playground">
	<div id='example7' class="ui-wrapper example" style='background: #E6F7D4;'>
		<div style='position: absolute; top: 20px; left: 20px; bottom: 20px; right: 20px;'>Drag me</div>
	</div>
</div>



<script type="text/javascript">

if(!window.console) {
 window.console = {
 	log: function() {
 		alert(arguments[0]);	
 	}	
 }	
}

$(window).bind("load",function(){

	$('#example1').draggable();
	$('#example2').draggable({ helper: 'clone', snap: true, snapMode: 'both', zIndex: 1000 });
	$('#example3').draggable({ cursorAt: {top: -5, left: -5 }, helper: function() { return $(document.createElement('div')).css({'background': '#fff', 'border': '1px solid black', 'padding': '5px'}).text("I'm a draggable!").appendTo("body")[0]; } });
	$('#example4').draggable({ helper: 'clone', revert: true });
	$('#example5').draggable({ helper: 'clone', axis: 'x' });
	$('#example6').draggable({ helper: 'clone', containment: 'parent' });
	$('#example7').draggable({ helper: 'clone', grid: [50,50] });

});

</script>
</body>
</html>
